'use strict'
$(function () {
    getListWithKeyword();
})
function getListWithKeyword(keyword){
    keyword= keyword|| ''
    if(keyword!=''){
        console.log(`你查询了${keyword}`);
    }
    getblogList(keyword).then(res =>{
            render(res.data)
    })
}
function render(data){
    console.log(data);
    let tb = $('#tbData');
    let rowData = $('.rowData');
    rowData.remove();
    console.log(data);
    data.forEach(item => {
        let h = `
            <tr class="rowData" key="${item.id}">
                <th>${item.id}</th>
                <th>${item.BName}</th>
                <th>${item.Contend}</th>
                <td>
                <input type="button" value="编辑" onclick="update(${item.id})">
                <input type="button" value="删除" onclick="del(${item.id})">
                </td>
            </tr>
            `
        tb.append(h);
    })
}